package org.pp.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Map;

import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 商品
 * </p>
 *
 * @author haima
 * @since 2024-06-02
 */
@Getter
@Setter
@TableName(value = "pp_goods",autoResultMap = true)
@Schema(name = "PpGoods", description = "商品")
public class PpGoods implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "商品id")
    @TableId(value = "goods_id", type = IdType.AUTO)
    private Long goodsId;

    @Schema(description = "商品名称")
    private String name;

    @Schema(description = "冗余分类id")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Long[] catIds;

    @Schema(description = "封面")
    private String cover;

    @Schema(description = "售价（sku的最小售价）")
    private BigDecimal price;

    @Schema(description = "幻灯片图片")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private String[] sliders;

    @Schema(description = "介绍")
    private String intro;

    @Schema(description = "商品详情，富文本")
    private String detailIntro;

    @Schema(description = "商品品牌等参数，json")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Map<String,Object> params;

    @Schema(description = "服务保障描述")
    private String ensure;

    @Schema(description = "销量，这个字段是sku销量之和，卖出去后更新")
    private Integer sales;

    @Schema(description = "单件运费")
    private BigDecimal postage;

    @Schema(description = "发货地")
    private String postFrom;

    @Schema(description = "是否免运费")
    private Boolean postageIfFree;

    @Schema(description = "是否服从系统满免运费规则")
    private Boolean postageInRuleIfFree;

    @Schema(description = "相同sku邮费是否合并")
    private Boolean postageSkuIfMerge;

    @Schema(description = "租户号")
    private Long tenantId;

    @Schema(description = "乐观锁")
    private Integer revision;

    @Schema(description = "创建时间")
    private LocalDateTime createdTime;

    @Schema(description = "更新时间")
    private LocalDateTime updatedTime;

    @Schema(description = "逻辑删除 1为删除 0为正常")
    @TableLogic
    private Boolean deleted;

    @Schema(description = "状态")
    private Integer status;
}
